package com.bc.bczbweb.controller.Ajax;

import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_User_walletService;
import com.bc.bcmodel.domain.T_User_walletModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.POST;
import java.math.BigInteger;

@RestController
@RequestMapping("ajax/t_user_wallet")
public class AjaxT_User_walletController {
    @Autowired
    T_User_walletService t_User_walletService;

    @POST
    @RequestMapping(value = "add", method = RequestMethod.POST)
    public JsonResult add(T_User_walletModel req) {
        JsonResult js = new JsonResult();
        if (req.getId() != null && req.getId().intValue() > 0) {
            t_User_walletService.update(req);
        } else {
            t_User_walletService.insert(req);
        }
        return js;
    }

    @RequestMapping("del")
    public JsonResult del(BigInteger id) {
        JsonResult js = new JsonResult();
        t_User_walletService.delete(id);
        return js;
    }
}